package com.yang.crawler.strategy.factory;

import com.yang.crawler.strategy.IArticleCrawlStrategy;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ArticleCrawlStrategyFactory {
    private static final Map<String, IArticleCrawlStrategy> articleReptileStrategyMap = new ConcurrentHashMap<>();

    public static void addArticleCrawlStrategy(String website, IArticleCrawlStrategy iArticleCrawlStrategy) {
        articleReptileStrategyMap.put(website, iArticleCrawlStrategy);
    }

    public static IArticleCrawlStrategy getArticleCrawlStrategy(String website) {
        return articleReptileStrategyMap.get(website);
    }
}

